package com.letv.common;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 各种索引常量定义
 *
 */
public class Constants  {

    /**
     * String, LeEco Resource ID perfix for vrs album
     */
    public static String VRS_ALBUM_PERFIX = "110_";

    /**
     * String, LeEco Resource ID perfix for leso album
     */
    public static String LESO_ALBUM_PERFIX ="205_";

    /**
     * String, LeEco Resource ID perfix for vrs video
     */
    public static String VRS_VIDEO_PERFIX = "101_";

    /**
     * String, LeEco Resource ID perfix for leso single video
     */
    public static String LESO_VIDEO_PERFIX = "201_";

    /**
     * String, 播控：TV
     */
    public static String PUSHFLAG_TV = "420007";

    /**
     * List<String>, tv牌照方站点源列表
     */
    public static List<String> TV_LICENSE_SOURCE_LIST;

    /**
     * boolean, true--用于计算影视大全的离线计算,false--用于计算非影视大全的离线计算
     */
    public static boolean IF_DAQUAN = false;

	// 从解析文件读取时的类型定义 0,Text;1,int;2,long;3,float;4,date
	public final int READ_AS_TEXT = 0;
	public final int READ_AS_INT = 1;
	public final int READ_AS_LONG = 2;
	public final int READ_AS_FLOAT = 3;
	public final int READ_AS_DATE = 4;
	public static String WEB_PATH = "";

	public final String FIEL_SEP = System.getProperty("file.separator");
	public final String LINE_SEP = System.getProperty("line.separator");

	public final char TAB = 9;
	public final char FLD_DATA_SEP = 31;

	// 数据库类型
	public static final String CBASE = "CBASE";// CHASE
	public static final String HBASE = "HBASE";// HBASE

	// 数据类型
	public static final int All = -1;// 全部
	public static final int ALBUM = 1;// 专辑
	public static final int LESO = 1;// LESO
	public static final int VIDEO = 2;// 视频
	public static final int STAR = 3;// 明星
	public static final int LIVE = 4;// 直播

	// 数据来源
	public static final String SRC_PTV = "0";// 来自PTV
	public static final String SRC_VRS = "1";// 来自VRS
	public static final String SRC_LESO = "2";// 来自外网
	public static final String SRC_IPTV = "3";// 来自IPTV
	public static final String SRC_LIVE = "4";// 来自直播
	public static final String SRC_ITV = "9";// 来自IPTV version1

	public static final String INDEX_ALBUM = "album";
	public static final String INDEX_VIDEO = "video";
	public static final String INDEX_STAR = "star";
	public static final String INDEX_LIVE = "live";
	public static final String INDEX_LESO = "leso";
	public static final String INDEX_LESO_EXTRAET = "lesoExtraet";

	public static final String ALL_PUSH_FLAG = "1,2,3,4,5,6,7";// 所有的推送平台
	public static final Set<String> DISPLAY_SET = new HashSet<String>();// 所有全网中展示的频道

	public static final String DISPLAY_NO = "0";// 所有全网中展示的数据
	public static final String DISPLAY_YES = "1";// 所有全网中展示的数据

	// 数据类型
	public static final String MQ_ACTION_ADD = "1";// 添加
	public static final String MQ_ACTION_MOD = "2";// 修改
	public static final String MQ_ACTION_DEL = "3";// 删除

	// 表名
	public static final String HBASE_PTVVIDEO = "ptvVideo";
	// public static final String PTVALBUM = "ptvAlbum";

	public static final String HBASE_VRSALBUM = "vrsAlbum";
	public static final String HBASE_VRSVIDEO = "vrsVideo";
	public static final String HBASE_VRSSTAR = "vrsStar";

	public static final String HBASE_IPTVVIDEO = "iptvVideo";
	public static final String HBASE_IPTVSTAR = "iptvStar";
	public static final String HBASE_IPTVALBUM = "iptvAlbum";
	public static final String HBASE_ITVALBUM = "itvAlbum";
	public static final String HBASE_ITVVIDEO = "itvVideo";

	public static final String HBASE_LESOALBUM = "lesoAlbum";
	public static final String HBASE_LIVEALBUM = "sportsLive";
	public static final String HBASE_TV_LIVEALBUM = "tvLive";

	// 搜索库download表名
	public static final String ALBUM_TB = "album";
	public static final String VIDEO_TB = "video";
	public static final String STAR_TB = "star";
	public static final String LESO_TB = "leso";

	/**
	 * String, table name.so_web_video_new/cp_info --> search2/cp_info
	 */
    public static final String CP_INFO_TB = "cp_info";

	// 搜索库download备份表名	
	public static final String ALBUM_OLD_TB = "old_album";
	public static final String VIDEO_OLD_TB = "old_video";
	public static final String STAR_OLD_TB = "old_star";
	public static final String LESO_OLD_TB = "old_leso";

    /**
     * String, old table name(for backups).so_web_video_new/cp_info --> search2/cp_info
     */
    public static final String CP_INFO_OLD_TB = "old_cp_info";

	// 搜索库index表名	
	public static final String ALBUM_INDEX_TB = "index_album";
	public static final String VIDEO_INDEX_TB = "index_video";
	public static final String STAR_INDEX_TB = "index_star";
	public static final String LIVE_INDEX_TB = "index_live";
	public static final String LESO_INDEX_TB = "index_leso";
	// 搜索库index备份表名		
	public static final String ALBUM_OLD_INDEX_TB = "old_index_album";
	public static final String VIDEO_OLD_INDEX_TB = "old_index_video";
	public static final String STAR_OLD_INDEX_TB = "old_index_star";
	public static final String LIVE_OLD_INDEX_TB = "old_index_live";
	public static final String LESO_OLD_INDEX_TB = "old_index_leso";
	//数据源表名
	public static final String ALBUM_SRC_TB = "con_album_info";
	public static final String VIDEO_SRC_TB = "con_video_info";
	public static final String STAR_SRC_TB = "db_star";
	public static final String LESO_SRC_TB = "video";
	public static final String LESO_EXTRAET_SRC_TB = "website_tmp";

	// iptv索引库
	public static final String IPTV_ALBUM = "iptv.album";// IPTV专辑
	public static final String IPTV_VIDEO = "iptv.video";// IPTV视频
	public static final String IPTV_STAR = "iptv.star";// IPTV明星

	// iptv索引库 大媒资改造
	public static final String ITV_ALBUM = "itv.album";// IPTV专辑
	public static final String ITV_VIDEO = "itv.video";// IPTV视频
	//public static final String ITV_STAR = "itv.star";// IPTV明星

	// 专辑索引库
	public static final String NORMAL_ALBUM = "normal.album";// VRS和PTV专辑
	public static final String NORMAL_VIDEO = "normal.video";// VRS和PTV视频
	public static final String NORMAL_STAR = "normal.star";// 明星

	public static final String LESO_ALBUM = "leso.album";// LESO专辑
	public static final String LIVE_ALBUM = "live.album";// live/直播

	// 索引库
	public static final List<String> INDEX_LIST = new ArrayList<String>();
	public static final List<String> TABLE_LIST = new ArrayList<String>();

	public static final String INDEX_INIT_FLAG = "index.init.flag";// 索引库初始化标识
	public static final String DICT_PATH = "dict.path";// 索引库初始化标识
	public static final String INDEXS = "index.list";// 同步设置

	// 索引切换配置
	public static final String IPTV_REMOTE_IP_LIST = "iptv.remote.ip.list";// 前端同步地址
	public static final String IPTV_REMOTE_HOST_PORT = "iptv.remote.host.port";// 前端同步地址端口

	// 排序类型
	public static final String DOUBLE = "DOUBLE";
	public static final String DATE = "DATE";
	public static final String LONG = "LONG";

	// 数据库类型
	public static final String DB_MYSQL = "mysql";
	// 数据源
	public static final String DATASOURCE_PTV = "ptv";
	public static final String DATASOURCE_VRS = "vrs";
	public static final String DATASOURCE_IPTV = "iptv";
	public static final String DATASOURCE_TOP = "top";
	public static final String DATASOURCE_LESO = "leso";

	public final static String WEBSITE_LETV = "letv"; // 乐视网
	public final static String WEBSITE_IQIYI = "iqiyi"; // 爱奇艺
	public final static String WEBSITE_QIYI = "qiyi"; // 爱奇艺
	public final static String WEBSITE_IMGO = "imgo"; // 芒果
	public final static String WEBSITE_YOUKU = "youku"; // 优酷
	public final static String WEBSITE_TUDOU = "tudou"; // 土豆
	public final static String WEBSITE_XUNLEI = "xunlei"; // 迅雷
	public final static String WEBSITE_KU6 = "ku6"; // 酷六
	public final static String WEBSITE_M1905 = "m1905"; // 电影网
	public final static String WEBSITE_PPTV = "pptv"; // PPTV
	public final static String WEBSITE_PPS = "pps"; // PPS
	public final static String WEBSITE_SOHU = "sohu"; // 搜狐视频
	public final static String WEBSITE_QQ = "qq"; // 腾讯视频
	public final static String WEBSITE_SINA = "sina"; // 11 新浪视频
	public final static String WEBSITE_56 = "56"; // 56
	public final static String WEBSITE_FUNSHION = "funshion"; // 13 风行
	public final static String WEBSITE_IFENG = "ifeng"; // 凤凰
	public final static String WEBSITE_KUMI = "kumi"; // 酷米
	public final static String WEBSITE_BEVA = "beva"; // 贝瓦
	public final static String WEBSITE_61 = "61"; // 淘米
	public final static String WEBSITE_YINYUETAI = "yinyuetai"; // 音悦台
	public final static String WEBSITE_CNTV = "cntv"; // CNTV
	public final static String WEBSITE_WASU = "wasu"; // 华数
	public final static String WEBSITE_EROS = "eros";
	public final static String WEBSITE_CIBN = "cibn";
	public final static String WEBSITE_WASUTV = "wasutv";
	public final static String WEBSITE_SHOWS = "shows_others";

	public final static int LESO_TV = 1; // 电视剧
	public final static int LESO_MOVIE = 2; // 电影
	public final static int LESO_WEIDIANYING = 202; // 微电影
	public final static int LESO_DONGMAN = 3; // 动漫
	public final static int LESO_ZONGYI = 4; // 综艺
	public final static int LESO_YINYUE = 5; // 音乐
	public final static int LESO_TIYU = 6; // 体育
	public final static int LESO_FENGSHANG = 7; // 风尚
	public final static int LESO_CAIJING = 8; // 财经
	public final static int LESO_QICHE = 9; // 汽车

	public static final String DOCUMENT_KEY_PTV_VIDEO = "vid";
	public static final String DOCUMENT_KEY_IPTV_VIDEO = "vid";
	public static final String DOCUMENT_KEY_IPTV_ALBUM = "aid";
	public static final String DOCUMENT_KEY_IPTV_STAR = "sid";
	public static final String DOCUMENT_KEY_VRS_VIDEO = "vid";
	public static final String DOCUMENT_KEY_VRS_ALBUM = "aid";
	public static final String DOCUMENT_KEY_VRS_STAR = "sid";

	public static final int ALBUM_PINYIN_LIMIT = 10;// 专辑拼音个数限制
	public static final int VIDEO_PINYIN_LIMIT = 1;// 视频拼音个数限制

	public final static String SPORTS_LIVE_URL = "http://st.live.letv.com/live/info/{0}/sports_tree.json"; // 2 爱奇艺
	public static final String TV_LIVE_CHANNELLIST_URL = "http://st.live.letv.com/live/playlist/channellist.json"; // 电视台直播
	public static final String TV_LIVE_URL = "http://st.live.letv.com/live/playlist/{0}/{1}.json"; // 电视台直播

	// 频道
	public static final int MOVIE = 1;			// 电影
	public static final int TV = 2;				// 电视剧
	public static final int AMUSE = 3;			// 娱乐
	public static final int SPORTS = 4;			// 体育
	public static final int CARTOON = 5;		// 动漫
	public static final int INFORMATION = 6;	// 资讯
	public static final int ORIGINAL = 7;		// 原创
	public static final int OTHERS = 8;			// 其他
	public static final int MUSIC = 9;			// 音乐
	public static final int FUN = 10;			// 搞笑
	public static final int VARIETY = 11;		// 综艺
	public static final int EDU = 12;			// 科教
	public static final int LIFE = 13;			// 生活
	public static final int CAR = 14;			// 汽车
	public static final int TVSHOW = 15;		// 电视节目
	public static final int DOCUMENTARY = 16;	// 纪录片
	public static final int OPENCOURSE = 17;	// 公开课
	public static final int LETVORIGINAL = 19;	// 乐视制造
	public static final int FASHION = 20;		// 风尚
	public static final int FINANCE = 22;		// 财经
	public static final int TRAVEL = 23;		// 旅游频道
	public static final int ISSUE = 30;			// 热点
	public static final int PARENT = 34;		// 亲子
	public static final int LETVPRODUCE = 202;	// 乐视出品

    public static final long VIDEO_CNT = 100000;// 视频表数量小于该值认为数据不正常

    // 内容类型
    public final static int CONTENT_TYPE_NORMAL = 1; // 一般内容
    public final static int CONTENT_TYPE_UGC = 2;// 自媒体UGC
    public final static int CONTENT_TYPE_PGC = 3;// Content Provider
    public final static int CONTENT_TYPE_YOUTUBE_PLAYLIST = 101;// Youtbue编单

    static {
        Constants.TV_LICENSE_SOURCE_LIST = new ArrayList<String>();
        Constants.TV_LICENSE_SOURCE_LIST.add(Constants.WEBSITE_CIBN);
        Constants.TV_LICENSE_SOURCE_LIST.add(Constants.WEBSITE_WASUTV);
        Constants.TV_LICENSE_SOURCE_LIST.add(Constants.WEBSITE_IMGO);
    }
}